<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<link rel="shortcut icon" href="favicon.ico">
<title>Satchi沙驰装修费用录入系统</title>
<style type="text/css">
@import url(css/stylemain.css);
.title {
	font-family: verdana, tahoma, sans-serif;
	FONT-SIZE: 10px;
	font-weight:bold
}
.grey {
	FONT-SIZE: 12px;
	color:#666666
}
.orange {
	font-family: verdana, tahoma, sans-serif;
	font-size:10px;
	color:#FF6600
}
.orange A:link {
	font-family: verdana, tahoma, sans-serif;
	font-size:10px;
	color:#FF6600;
	text-decoration:underline
}
.orange A:visited {
	font-family: verdana, tahoma, sans-serif;
	font-size:10px;
	color:#FF6600;
	text-decoration:underline
}
.orange A:hover {
	font-family: verdana, tahoma, sans-serif;
	font-size:10px;
	color:#FF6600;
	text-decoration:underline
}
.orange A:active {
	font-family: verdana, tahoma, sans-serif;
	font-size:10px;
	color:#FF6600;
	text-decoration:underline
}
.username {
	background-image:url(images/login/username.gif);
	background-position: 1px 1px;
	background-repeat:no-repeat;
	padding-left:20px;
	height:20px;
	FONT-SIZE: 12px;
}
.password {
	background-image:url(images/login/password.gif);
	background-position: 1px 1px;
	background-repeat:no-repeat;
	padding-left:20px;
	height:20px;
	FONT-SIZE: 12px;
}
h1.MainTitle {
	color:#CCC;
}
</style>
<script type="text/javascript" src="jquery/jquery.min.js"></script>
<script type="text/javascript" src="script/javascript.js"></script>
<script type="text/javascript" src="script/objects.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {
	if(window.location.href.indexOf("dialog") != -1) {
		var redirectUrl = "/satchipro" ;
		var width = screen.width ;   
		var height = screen.height ; 
		if (height == 768 ) height -= 75 ; 
		if (height == 600 ) height -= 60 ;
		var szFeatures = "top=0," ;
		szFeatures +="left=0," ;
		szFeatures +="width="+width+"," ;
		szFeatures +="height="+height+"," ;
		szFeatures +="directories=no," ;
		szFeatures +="status=yes," ;
		szFeatures +="menubar=no," ;
		if (height <= 600 ) szFeatures +="scrollbars=yes,";
		else szFeatures +="scrollbars=no," ;
		szFeatures +="resizable=yes" ; 
		//channelmode      /**   * 检查窗口是否被阻止   * updated by cyril on 2008-06-02   */   
		var newwin = window.open(redirectUrl,"",szFeatures) ;
		if(newwin!=null) {
			window.opener='satchi';
			window.open('','_self');
			window.close();
		}
	}
	
	// cookie login
	var uname = Cookie("satchipro_username");
	var upwd = Cookie("satchipro_pwd");
	if(uname!=null&&upwd!=null){
		$("#uname").val(uname);
		$("#upwd").val(upwd);
		login();
	}
});
function login() {
	$("#uname").attr("disabled", "true");
	$("#upwd").attr("disabled", "true");
	$("#loginInput").attr("disabled", "true");
	$.post("loginUser.do", {uname: $("#uname").val(), upwd: $("#upwd").val()},
		function(data) {
			if(data == "success"){
				Cookie("satchipro_username", $("#uname").val());
				Cookie("satchipro_pwd", $("#upwd").val());
				location.href = "index.jsp";
			}else{
				alert(data);
				$("#uname").removeAttr("disabled");
				$("#upwd").removeAttr("disabled");
				$("#loginInput").removeAttr("disabled");
			}
		}
	);
	return false;
}

function checkEnter() {
	if(event.keyCode == 13)
		event.keyCode = 9;
}
</script>
</head>
<body>
<html:form method="post" action="/loginUser.do">
  <div style="margin-top: 90px;">
    <h1 class="MainTitle"> 沙驰装修费用录入系统 </h1>
    <br />
  </div>
  <hr id="header_stripe" />
  <div id="page_container">
    <div id="toppanel">
      <div id="panel">
        <div id="panel_contents"> </div>
        <img class="border_pic" src="images/login/satchi1.jpg"
							alt="Satchi" />
        <div class="border" id="login"> <br />
          <p class="form_input_BG"> <span class="red_star">用户名：</span>
            <html:text styleClass="username" property="uname" onkeydown="checkEnter()" styleId="uname" style="width:150px;"></html:text>
            <span class="">*</span> </p>
          <br />
          <p class="form_input_BG"> <span class="red_star">密&nbsp;&nbsp;码 ：</span>
            <html:password styleClass="password" property="upwd" styleId="upwd" redisplay="false" style="width:150px;"/>
            <span class="">*</span> </p>
          <input title="登录" style="margin-left: 80px;" type="image" src="images/login_btn.png" name="loginInput" id="loginInput" onclick="login();" />
        </div>
      </div>
      <div class="panel_button" style="display: visible;"> <img src="images/login/expand.png" alt="expand" /><span>点击此处登录</span></div>
      <div class="panel_button" id="hide_button" style="display: none;"> <img src="images/login/collapse.png" alt="collapse" /><span>隐藏</span></div>
    </div>
    <div id="content">
      <p> 品牌特色：沙驰品牌本着高起点、高标准、严要求的作业态度，每一件产品从构思到设计、制品，都有经过严格的工序。每件产品既具有西方文化的特性的底蕴，每一细节都力求考究、自然，极力满足消费者对流行时尚、生活品位的喜爱与追求。 </p>
      <p> 品牌风格：沙驰品牌自问世以来，一直坚持"功能与时尚结合、流行与经典兼容"的独特风格，不断赶超世界时尚和流行的国际品牌品位，展现高贵的品牌时尚。 </p>
      <p> 品牌文化：在沙驰文化的创建上，公司本着“展现异域风格，弘扬鞋业文化，提升沙驰品位，塑造品牌形象”的原则，倾力塑造沙驰品牌的灵魂，竭力创造一种和谐的与品牌发展相适应的公司团队氛围，共建沙驰大家庭。 </p>
    </div>
    <div id="footer">
      <p> 上海沙驰服饰有限公司©版权所有 </p>
      <p> version: 1.0 </p>
    </div>
  </div>
</html:form>
</body>
</html>
